<template>
  <div class="cms-views-container my-collect-cms-pages">
    <header class="w-full h-10 px-4 leading-10 text-center">
      <span class="float-left">
        <LeftOutlined class="text-base" />
      </span>
      <span class="text-base text-[#333] font-medium">我的收藏</span>
      <span class="float-right pt-[9px] text-sm text-[#48494d]">{{ type === 2 || type === 3 ? '取消' : '编辑' }}</span>
    </header>
    <div class="mt-2 flex h-10 items-center px-[57px] justify-between text-base text-[#666]">
      <span :class="type === 1 || type === 2 || type === 3 || type === 6 ? 'active-tabbar' : ''">影视</span>
      <span :class="type === 4 ? 'active-tabbar' : ''">文章</span>
      <span :class="type === 5 ? 'active-tabbar' : ''">图集</span>
    </div>
    <div class="px-4 mt-4">
      <ul class="p-0 m-0 mt-3 history-contain" v-if="type === 1 || type === 2 || type === 3">
        <li v-for="(item, index) in 5" :key="index" class="flex items-center p-0 m-0 mb-4">
          <span v-if="type === 2 || type === 3" class="mr-[22px]">
            <img :src="mineIcons.checked" alt="" class="w-5 h-5" />
          </span>
          <span class="relative">
            <div class="article_shadow w-[134px] h-[75px] rounded-lg">
              <img :src="homeIcons.film" alt="" class="w-10 img-show" />
              <div v-if="index % 2 === 0" class="absolute top-0 right-0 free">免费</div>
              <div v-else class="absolute top-0 right-0 gold">
                <dollar-outlined class="gold-icon" />
                <span>100</span>
              </div>
            </div>
          </span>
          <span class="ml-3">
            <h3 class="text-sm text-black">影片名称</h3>
          </span>
        </li>
      </ul>
      <ul class="p-0 m-0 mt-3 history-contain" v-if="type === 4">
        <li v-for="(item, index) in 4" :key="index" class="flex items-center p-0 m-0 mb-4">
          <div class="article_shadow w-[79px] h-[108px] rounded-lg">
            <img :src="novelIcons.article" alt="" class="img-show w-[51px]" />
          </div>
          <span class="ml-3">
            <h3 class="text-sm text-black">小说名称</h3>
          </span>
        </li>
      </ul>
      <ul class="p-0 m-0 mt-3 history-contain" v-if="type === 5">
        <li v-for="(item, index) in 4" :key="index" class="flex items-center p-0 m-0 mb-4">
          <div class="article_shadow w-[79px] h-[108px] rounded-lg">
            <img :src="novelIcons.atlas" alt="" class="w-[51px] img-show" />
          </div>
          <span class="ml-3">
            <h3 class="text-sm text-black">图集名称</h3>
          </span>
        </li>
      </ul>
    </div>
    <div
      class="absolute bottom-0 left-0 right-0 flex items-center justify-between h-12 text-sm footer-border"
      v-if="type === 2 || type === 3"
    >
      <span class="w-2/5 text-center text-black">全选</span>
      <span class="text-[#f1f3f7]">|</span>
      <span class="w-2/5 text-center" :class="type === 2 ? 'text-[#b4b8bf]' : 'text-[#ff1c1c]'">删除</span>
    </div>
  </div>
</template>

<script setup lang="ts">
import { withDefaults } from 'vue'
import mineIcons from '../assets/mine'
import homeIcons from '../assets/home'
import novelIcons from '../assets/novel'

withDefaults(defineProps<{ type: number }>(), { type: 1 })
const baseUrl = '/src/components/cms/components/src/'

const novelEarlier = [
  {
    url: 'assets/img/herosystem.jpeg',
    title: '我的大侠养成系统',
    progression: '观看至80%',
    watchTime: '100px'
  },
  {
    url: 'assets/img/bltd.jpeg',
    title: '碧落天刀',
    progression: '观看至80%',
    watchTime: '100px'
  },

  {
    url: 'assets/img/gtzs.jpeg',
    title: '高天之上',
    progression: '观看至80%',
    watchTime: '100px'
  }
]

const atalsEarlier = [
  {
    url: 'assets/img/comics-fragments.webp',
    title: '诛仙.御剑行',
    progression: '已看完',
    watchTime: '100px'
  },
  {
    url: 'assets/img/comics-fragments.webp',
    title: '断片',
    progression: '观看至80%',
    watchTime: '100px'
  },
  {
    url: 'assets/img/linxu.jpeg',
    title: '150人',
    progression: '观看至24%',
    watchTime: '100px'
  }
]
</script>

<style scoped lang="less">
.my-collect-cms-pages {
  .active-tabbar {
    border-bottom: 2px solid #ff613f;
    color: #ff613f;
    font-weight: 500;
    padding-bottom: 3px;
  }
  .history-contain {
    li {
      list-style: none;
      @apply m-0;
    }
    .progress-border {
      background-image: linear-gradient(90deg, #ff9a73 0%, #ff613f 100%);
    }
  }
}
.free {
  width: 36px;
  height: 20px;
  background-image: linear-gradient(135deg, #ffa45d 0%, #ff613f 100%);
  border-radius: 0 8px 0 8px;
  font-size: 12px;
  color: #ffffff;
  padding: 2px 6px;
  position: absolute;
  right: 0;
  top: 0;
}
.gold {
  // width: 48px;
  height: 20px;
  background-image: linear-gradient(135deg, #eed78e 0%, #cbae6c 100%);
  border-radius: 0 8px 0 8px;
  font-size: 12px;
  color: #ffffff;
  padding: 2px 6px;
  position: absolute;
  right: 0;
  top: 0;
}
.gold-icon {
  margin-right: 2px;
  font-size: 14px;
}
.footer-border {
  border-top: 1px solid #f1f3f7;
}
</style>
